package com.shujia.wyh.mrdemos;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;

public class Demo {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new FileReader("bigdata23-hadoop/data/harry.txt"));

        String s = br.readLine();

        s = s.toLowerCase();
        String s1 = s.replace('’', ' ')
                .replace(',', ' ')
                .replace('.', ' ')
                .replace('—', ' ')
                .replace('…', ' ')
                .replace('!', ' ')
                .replace(';',' ');
        String s2 = s1.replaceAll("  ", " ");
        br.close();

        BufferedWriter bw = new BufferedWriter(new FileWriter("bigdata23-hadoop/data/harry2.txt"));
        bw.write(s2);
        bw.close();
    }
}
